package requests

import (
	"github.com/goravel/framework/contracts/http"
	"github.com/goravel/framework/contracts/validation"
	"goravel/app/models/common"
)

type RepairRequest struct {
	UserName    string `json:"user_name" form:"user_name"`
	Phone       string `json:"phone" form:"phone"`
	Way         int    `json:"way" form:"way"`
	OrderNo     string `form:"order_no"`
	UserID      string `json:"user_id" form:"user_id"`
	Description string `json:"description" form:"description"`
	//车牌
	CarID       uint            `json:"car_id" form:"car_id"`
	Images      []string        `json:"images" form:"images"`
	Coordinates common.CoordRes `json:"coordinates" form:"coordinates"`
	Address     string          `json:"address" form:"address"`
}

func (r *RepairRequest) Authorize(ctx http.Context) error {
	return nil
}

func (r *RepairRequest) Rules(ctx http.Context) map[string]string {
	return map[string]string{
		"user_name":   "required",
		"phone":       "required",
		"way":         "required",
		"description": "required",
		"car_id":      "required",
	}
}

func (r *RepairRequest) Messages(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *RepairRequest) Attributes(ctx http.Context) map[string]string {
	return map[string]string{}
}

func (r *RepairRequest) PrepareForValidation(ctx http.Context, data validation.Data) error {
	return nil
}
